package com.base.extendsdemo;

/*
 * Java是单继承，但可以多层
 */

class People{
	private int age;

	/**
	 * @return age
	 */
	public int getAge() {
		return age;
	}

	/**
	 * @param age 要设置的 age
	 */
	public void setAge(int age) {
		this.age = age;
	}
}

class Worker extends People{
	 public void tell(){
		 System.out.println(getAge());
	 }
}

//class PetWorker extends Worker{
//	public void tell(){
//		System.out.println(age);
//	}
//}


/*
 * Java中的是单继承
 */
public class ExtendDemo02 {
	public static void main(String[] args) {
       
	}
}